|
![](/i/fill.gif) |
> Why did you want to avaid a new variable, though? (And you actually
> werent avoiding any - #local always creates a new variable.) For
> elegance? Because of the memory requirements? A single new vector
> variable has a neglible cost in a recursive macro or anywhere else,
> for that matter.
I was avoiding one line of code for every parameter. And i'm going to
need lots of parameters, as there doesn't seem to be a
'record/struct/class' construction in POV :)
Instead of using the code below:
// pseudo code
#macro example(pos)
#while
example(pos)
#local pos = pos + y
#end
#end
I'm using now, as you suggested:
#macro example(pos)
#local var_pos = pos // this is what i have to do additionally
#while
example(var_pos)
#local var_pos = var_pos + y // because this should change the
// local value only
#end
#end
And it works exactly as I want it to :)
Thanks again for your reply,
Elias Pschernig
Post a reply to this message
|
![](/i/fill.gif) |